package com.ruyuan2020.im.chat.service.impl;

import com.ruyuan2020.im.chat.dao.ChatDAO;
import com.ruyuan2020.im.chat.domain.ChatDTO;
import com.ruyuan2020.im.chat.service.ChatService;
import com.ruyuan2020.im.common.core.util.BeanCopierUtils;
import com.ruyuan2020.im.common.web.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ChatServiceImpl implements ChatService {

    @Autowired
    private ChatDAO chatDAO;

    @Override
    @Transactional
    public void update(ChatDTO ChatDTO) {

    }

    @Override
    public List<ChatDTO> list() {
        Long accountId = SecurityUtils.getId();
        return BeanCopierUtils.convert(chatDAO.list(accountId), ChatDTO.class);
    }
}
